﻿using System.Collections.Generic;
using DevFramework.Business.Abstract;
using DevFramework.Business.DependencyResolvers.Ninject;
using DevFramework.Entities.Concrete;
using DevFramework.Entities.ComplexType;
using DevFramework.Entities.Concrete;

namespace DevFramework.Service
{
    public class ProductService : IProductService
    {
        private readonly IProductService _productService;

        public ProductService()
        {
            _productService = InstanceFactory<IProductService>.GetInstance();
        }

        public List<Product> GetAll()
        {
            return _productService.GetAll();
        }

        public Product Get(int id)
        {
            return _productService.Get(id);
        }

        public List<Product> GetByCategory(int categoryId)
        {
            return _productService.GetByCategory(categoryId);
        }

        public Product Add(Product product)
        {
            return _productService.Add(product);
        }

        public void Update(Product product)
        {
            _productService.Update(product);
        }

        public void Delete(Product product)
        {
            _productService.Delete(product);
        }

        public Product Add(Product product, Category category)
        {
           return _productService.Add(product, category);
        }

        public List<ProductDetail> GetWithCategory()
        {
            return _productService.GetWithCategory();
        }

        public List<Product> GetWithSp(int stok)
        {
            return _productService.GetWithSp(stok);
        }

        public void UpdateDate()
        {
            _productService.UpdateDate();
        }
    }
}
